package solutions;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class ShowSolution {
    public static void ShowDatabases(String rootpath)
    {
        List<String> list = new ArrayList<>();
        File file = new File(rootpath);
        File[] fileList = file.listFiles();
        if(fileList != null)
            for(int i = 0; i < fileList.length; i++){
                if(fileList[i].isDirectory()){
                    list.add(fileList[i].getName());
                }
            }
        System.out.println(list);
    }
    public static void ShowTables(String rootpath, String dbName)
    {
        List<String> list = new ArrayList<>();
        File file = new File(rootpath + '/' + dbName);
        File[] fileList = file.listFiles();
        if(fileList != null)
            for(int i = 0; i < fileList.length; i++){
                if(fileList[i].isDirectory()){
                    list.add(fileList[i].getName());
                }
            }
        System.out.println(list);
    }

}
